package com.lhm;

import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;

public class test1 {


    public static void main(String[] args) {
      /*  Integer i1 = 123;
        Integer i2 = 123;

        int i = 123;
        Integer i3 = new Integer(123);
        Integer i4 = new Integer(123);

        System.out.println("i1 == i2 ="+(i1 == i2));
        System.out.println("i1.equals(i2)= "+(i1.equals(i2)));

        System.out.println();
        System.out.println("i3 == i4 ="+(i3 == i4));
        System.out.println("i3.equals(i4) = "+(i3.equals(i4)));

        System.out.println();
        System.out.println("i2 == i4 ="+(i2 == i4));
        System.out.println("i2.equals(i4) = "+(i2.equals(i4)));

        System.out.println();
        System.out.println("i == i2 ="+(i == i2));
        System.out.println("i1.equals(i) = "+(i1.equals(i)));


        System.out.println();
        System.out.println("i == i4 ="+(i == i4));
        System.out.println("i4.equals(i) = "+(i4.equals(i)));
*/
     /*   String s1 ="Monday";
        String s2 ="Monday";
        if (s1 == s2)
            System.out.println("s1 == s2");
        else
            System.out.println("s1 != s2");*/

      /*  String s1 ="Monday";
        String s2 = new String("Monday");
        if (s1 == s2)
            System.out.println("s1 == s2");
        else
            System.out.println("s1 != s2");
        if (s1.equals(s2))
            System.out.println("s1 equals s2");
        else
            System.out.println("s1 not equals s2");*/

        int [] arr={1,3,6,7,3,7,9,2,2,1};

        List list = new ArrayList();
        for(int i=0;i<arr.length;i++){
            if(list.indexOf(arr[i])==-1)//检索新数组中是否有重复元素,没有就进数组
            {
                list.add(arr[i]);

            }

        }

        System.out.println(""+list);
    }


}
